package com.yyy.spring6.scope;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Project ：learn_spring
 * @File ：TestOrders.java
 * @IDE ：IntelliJ IDEA
 * @Author ：自由如风间
 * @Date ：2025/3/30 11:45
 * @Description ：For study.
 */

public class TestOrders {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean-scope.xml");
        // 单实例对象，输出结果相同
        // 多实例则不同
        Orders orders1 = context.getBean("orders", Orders.class);
        System.out.println(orders1);
        Orders orders2 = context.getBean("orders", Orders.class);
        System.out.println(orders2);
    }
}
